<template>
	<view>
		<view class="">
			<uni-table ref="table" border stripe emptyText="暂无更多数据">
				<uni-tr>
					<uni-th  align="center" v-for="(itemkey,index) in lists" :key="index">{{itemkey.uname}}</uni-th>
				</uni-tr>
				<uni-tr v-for="(itemvalue,index) in titlevalue" :key="index" >
					<uni-td v-for="its in itemvalue" :key="index"  align="center" >{{its}}</uni-td>
				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				datainfo: {},
				titlevalue:[],
				lists: [
					{
						uname: '客户',
						fv:'orderCustomerName',
						ulable: ''
					},
					{
						uname: '序号',
						fv:'serialNumber',
						ulable: ''
					},
					{
						uname: '安装宽度',
						fv:'sizeWidthWx',
						ulable: ''
					},
					{
						uname: '安装高度',
						fv:'sizeHeightWx',
						ulable: ''
					},
					{
						uname: '产品件数',
						fv:'productCount',
						ulable: ''
					},
					{
						uname: '成品宽度',
						fv:'sizeWidthSub',
						ulable: ''
					},
					{
						uname: '成品高度',
						fv:'sizeHeightSub',
						ulable: ''
					},
					{
						uname: '驱动方式',
						fv:'driveMode',
						ulable: ''
					},
					{
						uname: '外框颜色',
						fv:'color',
						ulable: ''
					},
					{
						uname: '叶片颜色',
						fv:'bladeColor',
						ulable: ''
					},
				]

			};
		},
		onLoad(option) {
			this.$api.getBatchInfo({
				id: option.id
			}).then(res => {
				if (res.code == 200) {
					this.datainfo = res.data
					this.datainfo.productParamList.forEach(item=>{
						this.lists.push({
							uname:item.paramName,
							fv:item.fv,
							ulable:''
						})
					})
					let list = this.lists
					this.datainfo.productList.forEach(its=>{
						let as = []
						list.forEach(keys =>{
							as.push(its[keys.fv])
						})
						this.titlevalue.push(as)
					})
				}
			})
			
			
		},

	}
</script>

<style lang="scss">

</style>